<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="src/style/base.css" />
    <link rel="stylesheet" href="src/style/normalize.css" />
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">

    <style>
        .container {
            width: calc(100% - 100px);
        }

        th,
        td {
            border-width: thin!important;
        }

        .el-table-column--selection .cell {
            text-align: center!important;
        }

        .el-table--border,
        .el-table--group {
            border-width: thin!important;
        }

        .search_box {
            width: 700px;
            margin: 0 auto;
        }

        .search_box_input {
            border: 2px #00c07b solid;
            width: 600px;
            height: 40px;
            box-sizing: border-box;
            padding: 3px 10px;
            outline: none;
            float: left;
        }

        .search_box_btn {
            background-color: #00c07b;
            width: 100px;
            height: 40px;
            border: none;
            cursor: pointer;
            float: left;
            color: white;
            font-size: 16px;
            outline: none;
        }

        .search_box_btn:hover {
            background-color: #00bf63;
        }

        .search_box_dropdown {
            width: 700px;
            height: 60px;
            margin: 0 auto;
        }

        .clearHistory {
            color: orangered;
            float: right;
            padding-right: 20px;
            font-size: 12px;
            cursor: pointer;
        }

        [v-cloak] {
            display: none;
        }
    </style>

</head>

<body>

    <div v-cloak class="container mt_20" id="app">



        <div class="search_box clearfix">
            <input type="text" class="search_box_input" v-model="searchVal" @keyup.enter="searchGo" placeholder="请输入关键字">
            <button class="search_box_btn" v-on:click="searchGo">搜 索</button>
        </div>

        <div class="search_box_dropdown mt_10" :close="tagClose">
            <el-button v-if="h.length>0" :type="h==searchVal?'success':'plain'" v-for="h in historyArr" size="mini" round v-on:click="historyBtnClick(h)">{{h}}</el-button>
            <a class="clearHistory" v-on:click="clearHistory">清除历史</a>

        </div>


        <el-table v-if="tableData.length>0" class="mt_20" border stripe :data="tableData" style="width: 100%">
            <el-table-column type="selection" width="55">
            </el-table-column>
            <el-table-column prop="id" label="文件名">
            </el-table-column>
            <el-table-column prop="author" label="作者" width="100">
            </el-table-column>
            <el-table-column prop="fileAbsolutePath" label="操作" width="400">
                <template slot-scope="scope">
                    <a class="el-button el-button--primary el-button--mini" target="_blank" href="highlight.html?keywords=coding,fighting,神彩">高亮预览</a>
                    <a class="el-button el-button--primary el-button--mini" target="_blank" href="preShow.html">在线预览</a>
                    <a class="el-button el-button--primary el-button--mini" :href="'file:///'+scope.row.fileAbsolutePath" download>下载</a>
                    <el-button type="danger" size="mini" @click="handleEdit(scope.$index, scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>


    </div>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <!-- import Vue before Element -->
    <script src="src/js/vue.js"></script>
    <!-- import JavaScript -->
    <script src="src/js/elementui.js"></script>

    <script src="src/js/lodash.js"></script>

    <script src="list.js"></script>
</body>

</html>